//
//  EmptyView.m
//  easystudy
//
//  Created by kane on 16/8/31.
//  Copyright © 2016年 kane. All rights reserved.
//

#import "EmptyView.h"

@implementation EmptyView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (id)init
{
    self = [super init];
    if (self) {
        self.frame = CGRectMake(0, 64, fWidth_Current, fHeight_Current - 64);
        UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(fWidth_Current/2 - 50, 100, 100, 100)];    
        imgView.image = [UIImage imageNamed:@"image_NoData"];
        [self addSubview:imgView];
        
        UILabel *lbl = [[UILabel alloc] initWithFrame:(CGRect){0,imgView.maxY+10,fWidth_Current,20}];
        lbl.font = [UIFont systemFontOfSize:13];
        lbl.textAlignment = NSTextAlignmentCenter;
        lbl.text = @"Sorry~,没有找到相关数据";
        [self addSubview:lbl];
    }
    return self;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.frame = CGRectMake(0, 64, fWidth_Current, fHeight_Current - 64);
        UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(fWidth_Current/2 - 50, 100, 100, 100)];
        imgView.image = [UIImage imageNamed:@"image_NoData"];
        [self addSubview:imgView];
        
        UILabel *lbl = [[UILabel alloc] initWithFrame:(CGRect){0,imgView.maxY+10,fWidth_Current,20}];
        lbl.font = [UIFont systemFontOfSize:13];
        lbl.textAlignment = NSTextAlignmentCenter;
        lbl.text = @"Sorry~,没有找到相关数据";
        [self addSubview:lbl];
    }
    return self;
}

@end
